package com.ruoyi.system.enums;

import lombok.Getter;

/**
 * @author : anxinr
 * @date : 2023/8/21 15:03
 */
@Getter
public enum DetailStatusEnum {

    DETAIL_STATUS_NORMAL(0 ,"正常运行中") ,
    DETAIL_STATUS_STOP(1 ,"暂停") ,
    DETAIL_STATUS_SUCCESS(2 , "完成")
    ;
    private Integer code ;
    private String message ;

    DetailStatusEnum(Integer code ,String message) {
        this.code = code ;
        this.message = message ;
    }

    public static String getMessageByCode(Integer code) {
        DetailStatusEnum[] values = DetailStatusEnum.values();
        for (DetailStatusEnum value : values) {
            if (value.getCode().equals(code)) {
                return value.getMessage() ;
            }
        }
        return "未知" ;
    }
}
